<?php
/**
 * Created by PhpStorm.
 * Author: 芸签cms www.yunqiancms.com
 * User: sun
 * Date: 2022/7/2
 * Time: 2:45 PM
 */
namespace app\backend\modules\content\services;

use app\common\models\Page;

class PageService
{
    public function getList($params){
        $query = Page::site()->select();
        if($params['title']){
            $query->where('title','like','%'.$params['title'].'%');
        }
        $list = $query
            ->orderBy('id', 'desc')
            ->paginate(10);
        $list->map(function ($v){
            $v->publish_time = date('Y-m-d H:i:s',$v->publish_time);
        });
        return $list;
    }
}